import os

root_path = os.path.dirname(os.path.abspath(__file__))

class MainConfig:
    """
    主页面坐标配置
    """
    ChengNei = (315, 20)
    ChengChi = (390, 20)
    DiTu = (450, 20)
    ZhanChang = (520, 20)
    Commanders = (730, 15)


class DiTuConfig:
    """
    地图页面坐标配置
    """
    CenterCity = (640, 290)
    EntryButton = (540, 365)
    SendButton = (625, 365)
    AttackButton = (720, 365)
    CallBackButton = (630, 400)
    TranslateButton = (725, 365)
    XText = (815, 540)
    YText = (860, 540)


class ChengNeiConfig:
    """
    城内页面坐标配置
    """
    BarrackPositions = [
        (530, 225), (480, 255),
        (585, 250), (530, 285),
        (635, 275), (585, 300),
        (690, 300), (640, 330),
        (750, 330), (690, 360),
        (800, 355), (750, 385),
    ]
    Warehouse = (685, 190)  # 仓库
    inn = (800, 300)  # 客栈
    ZhaoXianGuan = (860, 270)  # 招贤馆
    Resource = (40, 330)  # 资源
    Commanders = (100, 330)  # 将领


class Barrack:
    """
    兵营页面招兵配置
    """
    PageUp = (945, 190)
    PageDown = (945, 480)
    ZhaoMuButton = (665, 205)
    DoubleButton = (640, 380)
    NumText = (740, 405)
    SureButton = (705, 515)
    CloseButton = (920, 520)
    InitNum = 15  # 初始化按上键的次数
    NFPositionNum = 0  # 农夫翻页次数
    YBPositionNum = 1  # 义兵翻页次数
    CHPositionNum = 2  # 斥候翻页次数
    CQPositionNum = 3  # 长枪翻页次数
    DDPositionNum = 4  # 长枪翻页次数
    GJPositionNum = 5  # 弓箭翻页次数
    QQPositionNum = 6  # 轻骑翻页次数
    TQPositionNum = 7  # 铁骑翻页次数
    ZZPositionNum = 8  # 辎重翻页次数
    CNPositionNum = 9  # 床弩翻页次数

    TUQIPositionNum = 14  # 突骑翻页次数


class Warehouse:
    """
    仓库页面配置
    """
    DaBaoButton = (730, 505)  # 打包按钮
    DaBaoSureButton = (820, 450)  # 打包按钮
    CloseButton1 = (905, 505)
    CloseButton2 = (900, 450)
    CloseButton3 = (710, 400)

    FoodBoxTypePullButton = (620, 250)
    WoodBoxTypePullButton = (620, 285)
    MineBoxTypePullButton = (620, 325)
    IronBoxTypePullButton = (620, 360)
    FoodMaxButton = (700, 240)
    WoodMaxButton = (700, 280)
    MineMaxButton = (700, 315)
    IronMaxButton = (700, 355)


class Inn:
    """
    客栈页面配置
    """
    ZhaoMuButton = (700, 450)
    CloseButton = (925, 525)


class ZhaoXianGuan:
    """
    招贤馆页面配置
    """
    RenMing1 = (510, 205)
    RenMing2 = (710, 440)
    CloseButton1 = (920, 520)


class JiaoChang:
    """
    校场页面配置
    """
    MinFuText = (400, 165)  # 民夫输入框
    YiBingText = (540, 165)  # 义兵输入框
    ChiHouText = (400, 225)  # 斥候输入框
    ChangQiangText = (540, 225)  # 长枪兵输入框
    DaoDunText = (400, 285)  # 刀盾兵输入框
    GongJianText = (540, 285)  # 弓箭兵输入框
    QingQiText = (400, 340)  # 轻骑输入框
    TieQiText = (530, 345)  # 铁骑输入框
    ZiZhongText = (400, 395)  # 辎重输入框
    ChuangNuText = (530, 395)  # 床弩输入框

    FoodText = (715, 295)
    WoodText = (885, 295)
    MineText = (715, 350)
    IronText = (885, 345)
    GoldText = (715, 400)

    ChoseCommanderPullButton = (805, 185)

    FangAnPullButton = (395, 455)
    ChuZheng = (800, 515)
    CloseButton1 = (920, 515)


class Commanders:
    """
    将领页面配置
    """
    FireButton = (510, 465)
    CloseButton = (920, 515)
    SureButton = (585, 275)


class SolderResource:
    """
    招募兵员资源配置
    """
    MinFuType = {  # 民夫所需资源
        'Food': 50,
        'Wood': 150,
        'Mine': 0,
        'Iron': 10,
        'People': 1,
    }
    YiBingType = {  # 义兵所需资源
        'Food': 80,
        'Wood': 100,
        'Mine': 0,
        'Iron': 50,
        'People': 1,
    }
    ChiHouType = {  # 斥候所需资源
        'Food': 120,
        'Wood': 200,
        'Mine': 0,
        'Iron': 150,
        'People': 1,
    }
    ChangQiangType = {  # 长枪兵所需资源
        'Food': 150,
        'Wood': 500,
        'Mine': 0,
        'Iron': 100,
        'People': 1,
    }
    DaoDunType = {  # 刀盾兵所需资源
        'Food': 200,
        'Wood': 150,
        'Mine': 0,
        'Iron': 400,
        'People': 1,
    }
    GongJianType = {  # 弓箭兵所需资源
        'Food': 300,
        'Wood': 350,
        'Mine': 0,
        'Iron': 300,
        'People': 2,
    }
    QingQiType = {  # 轻骑所需资源
        'Food': 1000,
        'Wood': 600,
        'Mine': 0,
        'Iron': 500,
        'People': 3,
    }
    TieQiType = {  # 铁骑所需资源
        'Food': 2000,
        'Wood': 500,
        'Mine': 0,
        'Iron': 2500,
        'People': 6,
    }
    ZiZhongType = {  # 辎重所需资源
        'Food': 600,
        'Wood': 1500,
        'Mine': 0,
        'Iron': 350,
        'People': 4,
    }
    ChuangNuType = {  # 床弩所需资源
        'Food': 2500,
        'Wood': 3000,
        'Mine': 0,
        'Iron': 1800,
        'People': 5,
    }


class SoliderType:
    MinFu = {
        "resource": SolderResource.MinFuType,
        "jiaochang": JiaoChang.MinFuText,
        "barrack": Barrack.NFPositionNum,
    }
    YiBing = {
        "resource": SolderResource.YiBingType,
        "jiaochang": JiaoChang.YiBingText,
        "barrack": Barrack.YBPositionNum,
    }
    ChiHou = {
        "resource": SolderResource.ChiHouType,
        "jiaochang": JiaoChang.ChiHouText,
        "barrack": Barrack.CHPositionNum,
    }
    ChangQiang = {
        "resource": SolderResource.ChangQiangType,
        "jiaochang": JiaoChang.ChangQiangText,
        "barrack": Barrack.CQPositionNum,
    }
    DaoDun = {
        "resource": SolderResource.DaoDunType,
        "jiaochang": JiaoChang.DaoDunText,
        "barrack": Barrack.DDPositionNum,
    }
    GongJian = {
        "resource": SolderResource.GongJianType,
        "jiaochang": JiaoChang.GongJianText,
        "barrack": Barrack.GJPositionNum,
    }
    QingQi = {
        "resource": SolderResource.QingQiType,
        "jiaochang": JiaoChang.QingQiText,
        "barrack": Barrack.QQPositionNum,
    }
    TieQi = {
        "resource": SolderResource.TieQiType,
        "jiaochang": JiaoChang.TieQiText,
        "barrack": Barrack.TQPositionNum,
    }
    ZiZhong = {
        "resource": SolderResource.ZiZhongType,
        "jiaochang": JiaoChang.ZiZhongText,
        "barrack": Barrack.CNPositionNum,
    }
    ChuangNu = {
        "resource": SolderResource.ChuangNuType,
        "jiaochang": JiaoChang.ChuangNuText,
        "barrack": Barrack.CNPositionNum,
    }

